﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Db4objects.Db4o;
using System.IO;
using System.Windows.Forms;

namespace CDDocumentExtractor
{
    public static class DataAccess
    {
        //public string DatabasePath =""; 
        //// accessDb4o
        //IObjectContainer db;

        //public DataAccess()
        //{
        //    DatabasePath = Path.Combine(Application.StartupPath, "InfoOneDat.yap");
        //    db = Db4oEmbedded.OpenFile(Db4oEmbedded.NewConfiguration(), DatabasePath);
        //}

        public static IObjectContainer GetDataContainer()
        {
            string DatabasePath = Path.Combine(Application.StartupPath, "InfoOneDat.yap");
            var db =Db4oEmbedded.OpenFile(Db4oEmbedded.NewConfiguration(), DatabasePath);
            db.Ext().Configure().DetectSchemaChanges(true);
            return db;
        }
    }
}
